+2007-09-20 Cody Russell <bratsche@gnome.org>
+
+ * modules/engines/ms-windows/msw_style.c: Override draw_layout
+ method in GtkStyle in order to adjust by 2 pixels any labels
+ that are in GtkNotebook tabs using XP theme, so that they appear
+ correctly centered. (#478637)
+
2007-09-18 Emmanuele Bassi <ebassi@gnome.org>
* gtk/gtksearchenginetracker.c: Search libtrackerclient.so.0
*/
}
+static void
+draw_layout (GtkStyle *style,
+ GdkWindow *window,
+ GtkStateType state_type,
+ gboolean use_text,
+ GdkRectangle *area,
+ GtkWidget *widget,
+ const gchar *detail,
+ gint old_x,
+ gint old_y,
+ PangoLayout *layout)
+{
+ GtkNotebook *notebook = NULL;
+ gint x = old_x;
+ gint y = old_y;
+
+ /* In the XP theme, labels don't appear correctly centered inside
+ * notebook tabs, so we give them a gentle nudge two pixels to the
+ * right. A little hackish, but what are 'ya gonna do? -- Cody
+ */
+ if (xp_theme_is_active () && detail && !strcmp (detail, "label"))
+ {
+ if (widget->parent != NULL)
+ {
+ if (GTK_IS_NOTEBOOK (widget->parent))
+ {
+ notebook = GTK_NOTEBOOK (widget->parent);
+ int side = gtk_notebook_get_tab_pos (notebook);
+
+ if (side == GTK_POS_TOP || side == GTK_POS_BOTTOM)
+ {
+ x += 2;
+ }
+ }
+ }
+ }
+
+ parent_class->draw_layout (style, window, state_type,
+ use_text, area, widget,
+ detail, x, y, layout);
+}
+
static void
msw_style_init_from_rc (GtkStyle * style, GtkRcStyle * rc_style)
{
style_class->draw_resize_grip = draw_resize_grip;
style_class->draw_slider = draw_slider;
style_class->draw_focus = draw_focus;
+ style_class->draw_layout = draw_layout;
style_class->realize = msw_style_realize;
style_class->unrealize = msw_style_unrealize;